package com.shaozi.nc.mq.substance;

import org.apache.log4j.Logger;
import org.json.JSONObject;

import com.shaozi.data.mq.business.base.SourceTypeConsts.OA.Task;
import com.shaozi.data.mq.business.bean.MQExchangeRuleBean;
import com.shaozi.data.mq.business.bean.MQPushItem;
import com.shaozi.data.mq.business.bus.substance.BasePushSubstanceHandler;
import com.shaozi.lib.throwable.SzException;
import com.shaozi.nc.mq.bean.task.TaskAlarmBean;
import com.shaozi.nc.mq.bean.task.TaskDelBean;
import com.shaozi.nc.mq.bean.task.TaskSimpleDetailBean;


public class TaskPushSubstance extends BasePushSubstanceHandler {

	private final Logger logger = Logger.getLogger(TaskPushSubstance.class);

	public TaskPushSubstance() {

	}
	
	@Override
	protected void onExchangeBiz(MQExchangeRuleBean pushData, MQPushItem pushItem, JSONObject jsonObj)
			throws SzException {
		switch (pushItem.getSourceType()) {
		case Task.Alarm:
		case Task.DeleteAlarm:
			exchangeBiz(pushData, jsonObj, TaskAlarmBean.class);
			break;
		case Task.Del_Task:
			exchangeBiz(pushData, jsonObj, TaskDelBean.class);
			break;
		default:
			exchangeBiz(pushData, jsonObj, TaskSimpleDetailBean.class);
			break;
		}

	}

}
